{% extends 'base.html' %}
{% load static %}
{% load poll_extras %}
{% block main %}
<article> 
  <!--lbox begin-->
  <div class="lbox">
    <div class="whitebg bloglist">
      <h2 class="htitle">最新博文</h2>
      <ul>
          {% for article in article_list %}
            <li>
                {% if article.is_top %}
                    <h3 class="blogtitle"><a href="{% url 'blog:article' article.id %}" target="_blank"><b>【顶】</b>{{ article.title }}</a></h3>
                {% else %}
                    <h3 class="blogtitle"><a href="{% url 'blog:article' article.id %}" target="_blank">{{ article.title }}</a></h3>
                {% endif %}
                {% if article.is_original %}
                    <span class="blogpic imgscale"><i><a href="/">原创文章</a></i><a href="{% url 'blog:article' article.id %}" title=""><img src="{{ article.img.url }}" alt=""></a></span>
                {% else %}
                    <span class="blogpic imgscale"><a href="{% url 'blog:article' article.id %}" title=""><img src="{{ article.img.url }}" alt=""></a></span>
                {% endif %}

              <p class="blogtext">{{ article.summary }} </p>
              <p class="bloginfo"><i class="avatar"><img src="{{ article.author.avatar.url }}"></i><span>{{ article.author.username }}</span><span>{{ article.pub_time }}</span><span>{% for tag in article.tag.all %}【<a href="{% url 'blog:tag' tag %}">{{ tag }}</a>】{% endfor %}</span></p>
              <a href="{% url 'blog:article' article.id %}" class="viewmore">阅读更多</a> </li>
          {% endfor %}
      </ul>
      <!--pagelist-->
        <div class="pagelist">
        {% if article_list.has_previous %}
            <a href="{% url 'blog:all' %}">首页</a>
            <a href="?page={{ article_list.previous_page_number }}">上一页</a>
        {% endif %}

        {% for page in article_list.paginator.page_range %}
            {% circle_page article_list.number page %}
        {% endfor %}

        {% if article_list.has_next %}
            <a href="?page={{ article_list.next_page_number }}">下一页</a>
            <a href="?page={{ article_list.paginator.num_pages }}">尾页</a>
        {% endif %}
        </div>
      <!--pagelist end--> 
    </div>
    
    <!--bloglist end--> 
  </div>
  <div class="rbox">
    {% include 'include/click_rank.html' %}
    {% include 'include/recommend.html' %}
    {% include 'include/tag.html' %}
    {% include 'include/siteinfo.html' %}
  </div>
</article>
{% endblock %}